<?php

class Application_Form_Verify extends Zend_Form {

    public function init() {
        $this->setMethod("post");

        $number = new Zend_Form_Element_Text('number');
        $number->setLabel("Enter your mobile number:")
                ->setRequired()
                ->addFilter("StringTrim")
                ->addValidator('regex', false, array('/^[0-9 ]+$/'))
                ->setAttribs(array('class' => 'span12'))
                ->addErrorMessages(array("Invalid mobile number"));

        $code = new Zend_Form_Element_Text('code');
        $code->setLabel("Enter Verification Code:")
                ->setRequired()
                ->addFilter("StringTrim")
                ->addValidator('regex', false, array('/^[0-9 ]+$/'))
                ->setAttribs(array('class' => 'span12'))
                ->addErrorMessages(array("Invalid Code"));

        $submit = new Zend_Form_Element_Submit('submit');
        $submit->setLabel("Verify")
                ->setAttribs(array('class' => 'btn btn-success'));

        $this->addElements(array($number, $code, $submit));
    }

}

